package ru.fadeev.crammer;

import ru.fadeev.crammer.data.WordRecord;


/**
 * IndexerWordTask class extends IndexerTask and represents task for creating
 * phrase-index for given word. Created and added to storage after adding
 * or altering word.
 * @author Konstantin Fadeyev
 *
 */
public class IndexerWordTask extends IndexerTask {
	private int wordId;
	
	/**
	 * Creates instance of IndexerWordTask
	 * @param word word, GFIndexer should create index for
	 * @param inserted true, if this word is new word, false - if updated old
	 */
	public IndexerWordTask(WordRecord word, boolean inserted) {
		this.wordId = word.getId();
		this.text = word.getWord();
		this.inserted = inserted;
	}
	
	
	/**
	 * Creates instance of IndexerWordTask
	 * @param wordId word id,GFIndexer should create index for 
	 * @param wordText word text,GFIndexer should create index for
	 * @param inserted true, if this word is new word, false - if updated old
	 */
	public IndexerWordTask(int wordId, String wordText, boolean inserted) {
		this.wordId = wordId;
		this.text = wordText;
		this.inserted = inserted;
	}


	/**
	 * @return the wordId
	 */
	protected int getWordId() {
		return wordId;
	}


	/**
	 * @param wordId the wordId to set
	 */
	protected void setWordId(int wordId) {
		this.wordId = wordId;
	}
}
